package com.liaoyifan.core.exception;

import com.liaoyifan.core.enums.CoreCodeEnum;
import com.liaoyifan.core.enums.ICodeEnum;
import java.io.Serial;
import lombok.Getter;

@SuppressWarnings("unused")
@Getter
public class ResultException extends CoreException {

    @Serial private static final long serialVersionUID = 1L;

    public ResultException(ICodeEnum e) {
        super(e.getCode(), e.getMessage());
    }

    public ResultException(ICodeEnum e, Throwable cause) {
        super(e.getCode(), e.getMessage(), cause);
    }

    public ResultException(String message) {
        super(CoreCodeEnum.UNKNOWN.getCode(), message);
    }

    public ResultException(int code, String message) {
        super(code, message);
    }

    public ResultException(String message, Throwable cause) {
        super(CoreCodeEnum.UNKNOWN.getCode(), message, cause);
    }
}
